package luweiteng.demoForLogin.exception;


import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import luweiteng.demoForLogin.constant.ErrorCode;

@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class DocUserException extends RuntimeException {

    private static final long serialVersionUID = 2876204544450954025L;

    private Integer errorCode;

    private String errorMsg;

    public DocUserException(Integer errorCode, String errorMsg) {
        super(errorMsg);
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public DocUserException(ErrorCode errorCode) {
        super(errorCode.getErrorMsg());
        this.errorCode = errorCode.getErrorCode();
        this.errorMsg = errorCode.getErrorMsg();

    }
}
